{% load content_filters %}

<table cellpadding="8" cellspacing="1" height="100%">
    <thead>
        <tr>
            <td width="100">Фраза</td>
            <td width="100">Перевод</td>
            <td width="100">Группа</td>
            <td width="10">Добавлено</td>
        </tr>
    </thead>
    <tbody>
        {% if category %}
        {% for phrase in list_of_phrases %}
            <tr>
                <td width="100">
                    <a style="color:white;" href="{{ phrase.get_absolute_url }}">{{ phrase.phrase }}</a>
                </td>
                <td width="100">{{ phrase.translation }}</td>
                <td width="100">
                    {{ category }}
                </td>
                <td width="100">{{ phrase.created|date:"H:i d-m-Y" }}</td>
            </tr>
        {% endfor %}
        {% else %}
            {% with list_of_phrases=content_type|get_related_objects %}
            {% for phrase in list_of_phrases %}
                <tr>
                    <td width="100">
                        <a style="color:white;" href="{{ phrase.get_absolute_url }}">{{ phrase.phrase }}</a>
                    </td>
                    <td width="100">{{ phrase.translation }}</td>
                    <td width="100">
                        {{ phrase.group.name|title }}
                    </td>
                    <td width="100">{{ phrase.created|date:"H:i d-m-Y" }}</td>
                </tr>
            {% endfor %}
            {% endwith %}
        {% endif %}
    </tbody>
</table>

